package com.nantian.nfcm.bms.loan.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.nantian.nfcm.bms.loan.dao.LoanFilesDao;
import com.nantian.nfcm.bms.loan.entity.LoanFiles;

/**
 * 贷款资料service
 * @author ljx26_000
 *
 */
@Service
public class LoanFilesService {
	private LoanFilesDao loanFilesDao;
	
	@Autowired
	public LoanFilesService(LoanFilesDao loanFilesDao) {
		this.loanFilesDao = loanFilesDao;
	}
	
	/**
	 * 根据业务类型查询贷款资料字段
	 * @param businessType
	 * @return
	 */
	public LoanFiles findByBusinessType(String businessType, String businessSubType) {
		LoanFiles loanFiles = null;
		if (businessSubType == null || businessSubType.equals("")) {
			loanFiles = loanFilesDao.findByBusinessType(businessType);
		}else {
			loanFiles = loanFilesDao.findByBusinessTypeAndSubtype(businessType, businessSubType);
		}
		
		
		return loanFiles;
	}
}
